<?php

/**
 * AtkCharacter form base class.
 *
 * @method AtkCharacter getObject() Returns the current form's model object
 *
 * @package    aiontoolskit
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseAtkCharacterForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                    => new sfWidgetFormInputHidden(),
      'name'                  => new sfWidgetFormInputText(),
      'class_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameClass'), 'add_empty' => false)),
      'faction_id'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameFaction'), 'add_empty' => false)),
      'level'                 => new sfWidgetFormInputText(),
      'ambidextrous'          => new sfWidgetFormInputCheckbox(),
      'aion_permalink'        => new sfWidgetFormInputText(),
      'main'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameWeaponMain'), 'add_empty' => true)),
      'sub'                   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameWeaponSub'), 'add_empty' => true)),
      'torso'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorT'), 'add_empty' => true)),
      'glove'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorG'), 'add_empty' => true)),
      'shoulder'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorS'), 'add_empty' => true)),
      'leg'                   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorL'), 'add_empty' => true)),
      'foot'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorF'), 'add_empty' => true)),
      'head'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorH'), 'add_empty' => true)),
      'ring1'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryRO'), 'add_empty' => true)),
      'ring2'                 => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryRT'), 'add_empty' => true)),
      'necklace'              => new sfWidgetFormInputText(),
      'earring1'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryEO'), 'add_empty' => true)),
      'earring2'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryET'), 'add_empty' => true)),
      'belt'                  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryB'), 'add_empty' => true)),
      'maxHp'                 => new sfWidgetFormInputText(),
      'maxMp'                 => new sfWidgetFormInputText(),
      'bonusMp'               => new sfWidgetFormInputText(),
      'power'                 => new sfWidgetFormInputText(),
      'health'                => new sfWidgetFormInputText(),
      'agility'               => new sfWidgetFormInputText(),
      'accuracy'              => new sfWidgetFormInputText(),
      'knowledge'             => new sfWidgetFormInputText(),
      'will'                  => new sfWidgetFormInputText(),
      'walkSpeed'             => new sfWidgetFormInputText(),
      'runSpeed'              => new sfWidgetFormInputText(),
      'flySpeed'              => new sfWidgetFormInputText(),
      'attackSpeed'           => new sfWidgetFormInputText(),
      'bonusAttackSpeed'      => new sfWidgetFormInputText(),
      'evasion'               => new sfWidgetFormInputText(),
      'bonusEvasion'          => new sfWidgetFormInputText(),
      'block'                 => new sfWidgetFormInputText(),
      'bonusBlock'            => new sfWidgetFormInputText(),
      'parry'                 => new sfWidgetFormInputText(),
      'bonusParry'            => new sfWidgetFormInputText(),
      'mainHandAttack'        => new sfWidgetFormInputText(),
      'bonusMainHandAttack'   => new sfWidgetFormInputText(),
      'mainHandAccuracy'      => new sfWidgetFormInputText(),
      'bonusMainHandAccuracy' => new sfWidgetFormInputText(),
      'mainHandCritRate'      => new sfWidgetFormInputText(),
      'bonusMainHandCritRate' => new sfWidgetFormInputText(),
      'magicAccuracy'         => new sfWidgetFormInputText(),
      'bonusMagicAccuracy'    => new sfWidgetFormInputText(),
      'magicPower'            => new sfWidgetFormInputText(),
      'bonusMagicPower'       => new sfWidgetFormInputText(),
      'magicalResist'         => new sfWidgetFormInputText(),
      'bonusMagicResist'      => new sfWidgetFormInputText(),
      'physicalDef'           => new sfWidgetFormInputText(),
      'bonusPhyDef'           => new sfWidgetFormInputText(),
      'resistFire'            => new sfWidgetFormInputText(),
      'resistWater'           => new sfWidgetFormInputText(),
      'resistWind'            => new sfWidgetFormInputText(),
      'resistEarth'           => new sfWidgetFormInputText(),
      'subHandAttack'         => new sfWidgetFormInputText(),
      'bonusSubHandAttack'    => new sfWidgetFormInputText(),
      'subHandAccuracy'       => new sfWidgetFormInputText(),
      'bonusSubHandAccuracy'  => new sfWidgetFormInputText(),
      'subHandCritRate'       => new sfWidgetFormInputText(),
      'bonusSubHandCritRate'  => new sfWidgetFormInputText(),
      'created_at'            => new sfWidgetFormDateTime(),
      'updated_at'            => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'name'                  => new sfValidatorString(array('max_length' => 255)),
      'class_id'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameClass'))),
      'faction_id'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameFaction'))),
      'level'                 => new sfValidatorInteger(array('required' => false)),
      'ambidextrous'          => new sfValidatorBoolean(array('required' => false)),
      'aion_permalink'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'main'                  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameWeaponMain'), 'required' => false)),
      'sub'                   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameWeaponSub'), 'required' => false)),
      'torso'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorT'), 'required' => false)),
      'glove'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorG'), 'required' => false)),
      'shoulder'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorS'), 'required' => false)),
      'leg'                   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorL'), 'required' => false)),
      'foot'                  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorF'), 'required' => false)),
      'head'                  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameArmorH'), 'required' => false)),
      'ring1'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryRO'), 'required' => false)),
      'ring2'                 => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryRT'), 'required' => false)),
      'necklace'              => new sfValidatorInteger(array('required' => false)),
      'earring1'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryEO'), 'required' => false)),
      'earring2'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryET'), 'required' => false)),
      'belt'                  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('GameAccessoryB'), 'required' => false)),
      'maxHp'                 => new sfValidatorInteger(array('required' => false)),
      'maxMp'                 => new sfValidatorInteger(array('required' => false)),
      'bonusMp'               => new sfValidatorInteger(array('required' => false)),
      'power'                 => new sfValidatorInteger(array('required' => false)),
      'health'                => new sfValidatorInteger(array('required' => false)),
      'agility'               => new sfValidatorInteger(array('required' => false)),
      'accuracy'              => new sfValidatorInteger(array('required' => false)),
      'knowledge'             => new sfValidatorInteger(array('required' => false)),
      'will'                  => new sfValidatorInteger(array('required' => false)),
      'walkSpeed'             => new sfValidatorPass(array('required' => false)),
      'runSpeed'              => new sfValidatorNumber(array('required' => false)),
      'flySpeed'              => new sfValidatorNumber(array('required' => false)),
      'attackSpeed'           => new sfValidatorPass(array('required' => false)),
      'bonusAttackSpeed'      => new sfValidatorPass(array('required' => false)),
      'evasion'               => new sfValidatorInteger(array('required' => false)),
      'bonusEvasion'          => new sfValidatorInteger(array('required' => false)),
      'block'                 => new sfValidatorInteger(array('required' => false)),
      'bonusBlock'            => new sfValidatorInteger(array('required' => false)),
      'parry'                 => new sfValidatorInteger(array('required' => false)),
      'bonusParry'            => new sfValidatorInteger(array('required' => false)),
      'mainHandAttack'        => new sfValidatorInteger(array('required' => false)),
      'bonusMainHandAttack'   => new sfValidatorInteger(array('required' => false)),
      'mainHandAccuracy'      => new sfValidatorInteger(array('required' => false)),
      'bonusMainHandAccuracy' => new sfValidatorInteger(array('required' => false)),
      'mainHandCritRate'      => new sfValidatorInteger(array('required' => false)),
      'bonusMainHandCritRate' => new sfValidatorInteger(array('required' => false)),
      'magicAccuracy'         => new sfValidatorInteger(array('required' => false)),
      'bonusMagicAccuracy'    => new sfValidatorInteger(array('required' => false)),
      'magicPower'            => new sfValidatorInteger(array('required' => false)),
      'bonusMagicPower'       => new sfValidatorInteger(array('required' => false)),
      'magicalResist'         => new sfValidatorInteger(array('required' => false)),
      'bonusMagicResist'      => new sfValidatorInteger(array('required' => false)),
      'physicalDef'           => new sfValidatorInteger(array('required' => false)),
      'bonusPhyDef'           => new sfValidatorInteger(array('required' => false)),
      'resistFire'            => new sfValidatorInteger(array('required' => false)),
      'resistWater'           => new sfValidatorInteger(array('required' => false)),
      'resistWind'            => new sfValidatorInteger(array('required' => false)),
      'resistEarth'           => new sfValidatorInteger(array('required' => false)),
      'subHandAttack'         => new sfValidatorInteger(array('required' => false)),
      'bonusSubHandAttack'    => new sfValidatorInteger(array('required' => false)),
      'subHandAccuracy'       => new sfValidatorInteger(array('required' => false)),
      'bonusSubHandAccuracy'  => new sfValidatorInteger(array('required' => false)),
      'subHandCritRate'       => new sfValidatorInteger(array('required' => false)),
      'bonusSubHandCritRate'  => new sfValidatorInteger(array('required' => false)),
      'created_at'            => new sfValidatorDateTime(),
      'updated_at'            => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('atk_character[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'AtkCharacter';
  }

}
